package JUC.猴子吃桃子;

public class MonkeyEat {
    private int peachs=100;
    private Object lock = new Object();

    public static void main(String[] args) {

    }

    public void monkeyEat() {
        while (peachs>=0) {
            synchronized (lock) {
                
            }
        }
    }
}
